package com.telkomsigma.spring.hibernate.persistence.domain;

import java.io.Serializable;
import java.sql.Blob;

import javax.persistence.*;


import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.OneToOne;
import javax.persistence.Table;


/**
 * The persistent class for the photo database table.
 * 
 */
@Entity
@Table(name="photo")
public class Photo implements Serializable {
	private static final long serialVersionUID = 1L;
	private int id;
	private Blob data;
	private TPlayer player;

    public Photo() {
    }


	@Id
	@Column(unique=true, nullable=false)
	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}


    @Lob()
	@Column(nullable=false)
	public Blob getData() {
		return this.data;
	}

	public void setData(Blob data) {
		this.data = data;
	}


	//bi-directional one-to-one association to Player
	@OneToOne(mappedBy="photo")
	public TPlayer getPlayer() {
		return this.player;
	}

	public void setPlayer(TPlayer player) {
		this.player = player;
	}
	
}